import MyContext from "./Context";
import React from "react";

const ChildNum = () => {
  const { store, dispatch } = React.useContext(MyContext);

  console.log("DEMO1: re-render ChildNum", store.num);
  return (
    <div className="Child-container">
      <div>num is: {store.num}</div>
      <button onClick={() => dispatch({ type: "addNum" })}> AddNum </button>
    </div>
  );
};

export default ChildNum;
